package com.cn.wanxi.util;

import java.math.BigDecimal;

public class Tool {
    public static int stringToInt(String value) {
        try {
            return Integer.parseInt(value);
        } catch (Exception e) {
            return -1;
        }

    }

    public static int pageToInt(String value) {
        try {
            return Integer.parseInt(value);
        } catch (Exception e) {
            return 1;
        }

    }

    public static int limitToInt(String value) {
        try {
            return Integer.parseInt(value);
        } catch (Exception e) {
            return 10;
        }

    }

    public static BigDecimal stringToMoney(String value) {
        try {
            return new BigDecimal(value);
        } catch (Exception e) {
            return null;
        }

    }
}
